# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Mico Tischler <mt-ml at gmx dot net>
# Contributor: Keshav Amburay <(the ddoott ridikulus ddoott rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>

pkgname=sbsigntools
pkgver=0.9.4
pkgrel=1
pkgdesc="Tools to add signatures to EFI binaries and Drivers"
arch=('x86_64')
url="https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git/about"
license=('GPL3')
depends=('glibc' 'openssl')
makedepends=('git' 'gnu-efi' 'help2man' 'util-linux-libs')
source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git#tag=v${pkgver}?signed"
        "git+https://git.ozlabs.org/ccan")
sha256sums=('SKIP'
            'SKIP')
validpgpkeys=('D5606E73C8B46271BEAD9ADF814AE47C214854D6') # James Bottomley <jejb@kernel.org>

prepare() {
  cd ${pkgname}
  git submodule init
  git config submodule."lib/ccan.git".url "${srcdir}/ccan"
  git submodule update
  ./autogen.sh
}

build() {
  cd "${pkgname}"
  ./configure --prefix="/usr" \
              --bindir="/usr/bin" \
              --sbindir="/usr/bin" \
              --libexecdir="/usr/lib" \
              --mandir="/usr/share/man" \
              --sysconfdir="/etc"
  make
}

package() {
  depends+=('libuuid.so')
  cd "${pkgname}"
  make DESTDIR="${pkgdir}" install
  install -vDm 644 {AUTHORS,ChangeLog,NEWS,README} \
    -t "${pkgdir}/usr/share/doc/${pkgname}"
}
